package com.zhl.utils;

import java.util.Random;
import java.util.UUID;

public class StrUtil {
    public static String getUUID() {
        UUID uuid = UUID.randomUUID();
        return uuid.toString();
    }

    /**
     * 随机获取四位数的字符串
     *
     * @return str
     */
    public static String getRandomStr() {
        StringBuilder sb = new StringBuilder();
        Random random = new Random();
        for (int i = 0; i < 4; i++) {
            int r = random.nextInt(10);
            sb.append(r);
        }
        return sb.toString();
    }
}
